Microsoft Windows [版本 10.0.19045.2311]
(c) Microsoft Corporation。保留所有权利。

C:\Users\Administrator>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

C:\Users\Administrator>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.36 MySQL Community Server - GPL

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases
    -> ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> create database spider character set utf8;
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> use spider
Database changed
mysql> create table teacherinfo(id int auto_increment primary key,
    -> tno char(6) character set utf8,
    -> tname varchar(10) character set utf8,
    -> remark varchar(50) character set utf8);
Query OK, 0 rows affected, 3 warnings (0.03 sec)

mysql> create table bookinfo(
    -> id int auto_increment primary key,
    -> bookname varchar(100) character set utf8,
    -> autor varchar (200) character set utf8,
    -> autor varchar (100) character set utf8,
    -> press varchar (200) character set utf8,
    -> pubdate varchar (20) character set utf8,
    -> describ varchar (3000) character set utf8
    -> );
ERROR 1060 (42S21): Duplicate column name 'autor'
mysql> create table bookinfo(
    -> id int auto_increment primary key,
    -> bookname varchar(100) character set utf8,
    -> autor varchar (100) character set utf8,
    -> press varchar (200) character set utf8,
    -> pubdate varchar (20) character set utf8,
    -> describ varchar (3000) character set utf8
    -> );
Query OK, 0 rows affected, 5 warnings (0.03 sec)

mysql> desc bookinfo;
+----------+---------------+------+-----+---------+----------------+
| Field    | Type          | Null | Key | Default | Extra          |
+----------+---------------+------+-----+---------+----------------+
| id       | int           | NO   | PRI | NULL    | auto_increment |
| bookname | varchar(100)  | YES  |     | NULL    |                |
| autor    | varchar(100)  | YES  |     | NULL    |                |
| press    | varchar(200)  | YES  |     | NULL    |                |
| pubdate  | varchar(20)   | YES  |     | NULL    |                |
| describ  | varchar(3000) | YES  |     | NULL    |                |
+----------+---------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)

mysql> select * from bookinfo;
Empty set (0.00 sec)

mysql> select * from bookinfo;
Empty set (0.00 sec)

mysql> select * from bookinfo;
Empty set (0.00 sec)

mysql> alter table bookinfo add column score varchar(20) set utf8;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set utf8' at line 1
mysql> alter table bookinfo add column score varchar(20) character set utf8;
Query OK, 0 rows affected, 1 warning (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 1

mysql> desc nookinfo;
ERROR 1146 (42S02): Table 'spider.nookinfo' doesn't exist
mysql> desc bookinfo;
+----------+---------------+------+-----+---------+----------------+
| Field    | Type          | Null | Key | Default | Extra          |
+----------+---------------+------+-----+---------+----------------+
| id       | int           | NO   | PRI | NULL    | auto_increment |
| bookname | varchar(100)  | YES  |     | NULL    |                |
| autor    | varchar(100)  | YES  |     | NULL    |                |
| press    | varchar(200)  | YES  |     | NULL    |                |
| pubdate  | varchar(20)   | YES  |     | NULL    |                |
| describ  | varchar(3000) | YES  |     | NULL    |                |
| score    | varchar(20)   | YES  |     | NULL    |                |
+----------+---------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)